import Vue from "vue"  //Vue是自己起的变量别名  "vue"  默认是rutime.vue版本
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import VueResouce from 'vue-resource'
Vue.use(VueResouce)
// 设置请求的跟路径 必须放在Vue.use(VueResouce)之后
Vue.http.options.root = 'http://www.liulongbin.top:3005';
Vue.http.options.emulateJSON = true
// import { Header, Swipe, SwipeItem,  Button ,Lazyload} from 'mint-ui';
// Vue.component(Header.name, Header);  //css 样式
// Vue.component(Swipe.name, Swipe); 
// Vue.component(SwipeItem.name, SwipeItem); 
// Vue.component(Button.name, Button); 
// Vue.use(Lazyload); 

import MintUI from 'mint-ui'
Vue.use(MintUI)
import moment from 'moment'
// // 安装图片预览插件
// import VuePreview from 'vue-preview'
// Vue.use(VuePreview)
import Vue2Preview from 'vue2-preview'
Vue.use(Vue2Preview)

import app from './app'
import router from './router'

import 'mint-ui/lib/style.css'
// 购物车小图标
import './lib/mui-master/dist/css/mui.min.css'
import './lib/mui-master/dist/css/icons-extra.css'


// 定义全局过滤器 
Vue.filter('timeFormat', function (timeStr, pattern = "YYYY-MM-DD HH:mm:ss") {
    // cnpm i moment -D 时间格式化插件
    return moment(timeStr).format(pattern)

})

var vm = new Vue({
    el: "#app",
    render(h) {
        return h(app)
    },
    router
})